<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html>
<head>
    <title>腾邦授权登录</title>
</head>
<body>
	<div style="text-align: center;">
		<h2 class="page-header" style="margin-top: 80px">腾邦授权登录</h2>
		<div class="row" >
		    <div class="col-md-4"  style="margin-left: 30%">
		        <form action="${pageContext.request.contextPath}/login.do"  method="post" class="form-horizontal">
		            <div class="form-group" style="text-align: center;">
		                <label for="username" class="col-sm-3 control-label">用户名</label>
		                <div class="col-sm-9">
		                    <input type="text" id="username" name="username" value="" placeholder="Type username" required="required" class="form-control"/>
		                </div>
		            </div>
		            <div class="form-group">
		                <label for="password" class="col-sm-3 control-label">密码</label>
		                <div class="col-sm-9">
		                    <input type="password" name="password" id="password" value="" placeholder="Type password" required="required" class="form-control"/>
		                </div>
		            </div>
		            <input type="submit" value="登录" class="btn btn-primary"/>
		            <a style ="margin-left: 30px" href="${pageContext.request.contextPath}">返回</a>&nbsp;
		            <%--Login error--%>
		            <div class="form-group">
		                <c:if test="${param.authorization_error eq 2}">
		            		<span class="label label-danger">拒绝访问！</span>
			            </c:if>
			            <c:if test="${param.authentication_error eq 1}">
		            		<span class="label label-danger">用户名不存在或密码错误！</span>
			            </c:if>
		            </div>
		        </form>
		    </div>
		</div>
		
		<div>
		    <p>You can use the users to login as follow:</p>
		    <table class="table table-bordered">
		        <thead>
		        <tr>
		            <th>Username</th>
		            <th>Password</th>
		            <th>Privileges</th>
		        </tr>
		        </thead>
		        <tbody>
		        <tr>
		            <td>admin</td>
		            <td>admin</td>
		            <td>All privileges, allow visit [Mobile] and [Unity] resources</td>
		        </tr>
		        <tr>
		            <td>unity</td>
		            <td>unity</td>
		            <td>Only allow visit [Unity] resource, support grant_type:
		                <em>authorization_code,refresh_token,implicit</em></td>
		        </tr>
		        <tr>
		            <td>mobile</td>
		            <td>mobile</td>
		            <td>Only allow visit [Mobile] resource, support grant_type: <em>password,refresh_token</em></td>
		        </tr>
		        </tbody>
		    </table>
		</div>
		
	</div>
</body>
</html>